package io;

import java.io.*;
import java.util.Scanner;

/**
 * 完成简易记事本
 */
public class Test3 {
    public static void main(String[] args) throws FileNotFoundException {
        Scanner scan = new Scanner(System.in);
        FileOutputStream fos = new FileOutputStream("test3.txt");
        OutputStreamWriter osw = new OutputStreamWriter(fos);
        BufferedWriter bw = new BufferedWriter(osw);
        PrintWriter pw = new PrintWriter(bw, true);
        while (true) {
            String str = scan.nextLine();
            if ("exit".equals(str)) {
                break;
            }
            pw.println(str);
        }
        System.out.println("写出完毕");
        pw.close();
    }
}
